public class Test2 {
    public static void main(String[] args) {
        String s=", , , ,      a, acd";
        int len=s.length();
        int count=0;
        if(len==0){
            ;
        }
        String[] s2=s.split(" ");
        for (String r:s2) {
            if(r.length()!=0){
                count++;
            }
        }
        System.out.println(count);
    }
}
